package com.yisen.proxy;

import java.lang.reflect.Proxy;

public class Main {
    public static void main(String[] args) {
        System.getProperties().put("sun.misc.ProxyGenerator.saveGeneratedFiles", "true"); //设置系统属性
        Animal o = (Animal)Proxy.newProxyInstance(Dog.class.getClassLoader(), new Class[]{Animal.class}, new DogProxy(new Dog()));

        o.cry();
    }
}
